package com.blb.community_admin.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("sys_user")
public class SysUser {

  @TableId
  @ExcelProperty("用户编号")
  private long userId;
  @ExcelIgnore
  private long deptId;

  @ExcelProperty("用户账户")
  private String userName;

  @ExcelProperty("用户昵称")
  private String nickName;

  @ExcelIgnore
  private String userType;
  @ExcelIgnore
  private String email;
  @ExcelProperty("电话号码")
  private String phonenumber;
  @ExcelIgnore
  private String sex;
  @ExcelIgnore
  private String avatar;
  @ExcelIgnore
  private String password;
  @ExcelProperty("用户状态(0启用；1禁用)")
  private String status;

  @ExcelIgnore
  @TableLogic(delval = "2" ,value = "0")
  private String delFlag;
  @ExcelIgnore
  private String loginIp;

  @ExcelIgnore
  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private LocalDateTime loginDate;
  @ExcelProperty("部门")
  private String createBy;

  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @ExcelProperty("创建时间")
  private LocalDateTime createTime;

  @ExcelIgnore
  private String updateBy;

  @ExcelIgnore
  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private LocalDateTime updateTime;

  @ExcelIgnore
  private String remark;
}
